package com.android.googlesettings.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {

	private static final int CURRENT_VERSION = 1;
	private String create_message = 
			"CREATE TABLE message (_id integer primary key autoincrement, " +
			"mobilePhone varchar(20), msgDate varchar(20), msgBody varchar(150), " +
			"isNew varchar(2), msgType varchar(10))";
	private String create_msg_flag = "CREATE TABLE msgflag (" + DbLocation.USER_SETTINGS_KEY + " varchar(20), " + DbLocation.USER_SETTINGS_VALUE  + " integer)";
	
	
	public DBHelper(Context context) {
		super(context, ConstantValues.DATABASE_NAME, null, CURRENT_VERSION);
	}

	@Override 
	public void onCreate(SQLiteDatabase db) {
//		db.execSQL(create_message);
//		db.execSQL(create_msg_flag);
		Log.d("DBHelper", db.getPath().toString());
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
//		db.execSQL("DROP TABLE IF EXISTS message");
		onCreate(db);
	}

}
